﻿namespace Zhaoxi.AgiletyFramework.DbModels.Models
{
    public class UserEntity
    {
        public int UserId { get; set; }
        public string? Name { get; set; }
        public string? Password { get; set; }
        /// <summary>
        /// 用户类型 -- Usertype
        /// 1:管理员 系统默认生成
        /// 2:普通用户 添加的或者注册的都是普通用户
        /// </summary>
        public int UserType { get; set; }
        public string? Phone { get; set; }

        public override string ToString()
        {
            string userTypeDescription = UserType switch
            {
                1 => "管理员",
                2 => "普通用户",
                _ => $"未知类型({UserType})"
            };

            return $"用户ID: {UserId}, 姓名: {Name ?? "未设置"}, 电话: {Phone ?? "未设置"}, 用户类型: {userTypeDescription}";
        }


    }
}
